package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.Collect;
import com.ruoyi.system.domain.CollectDto;
import com.ruoyi.system.mapper.CollectMapper;
import com.ruoyi.system.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectServiceImpl extends ServiceImpl<CollectMapper, Collect> implements CollectService {
    @Autowired
    private CollectMapper collectMapper;

    @Override
    public Integer insertCollect(Collect collect) {
        Integer integer = collectMapper.insertCollect(collect);
        return integer;
    }

    @Override
    public Integer deleteCollect(Integer user_id, Integer productId) {
        Integer integer = collectMapper.deleteCollect(user_id, productId);
        return integer;
    }

    @Override
    public List<CollectDto> getCollect(Integer user_id,Integer productId) {
        List<CollectDto> collect = collectMapper.getCollect(user_id,productId);
        return collect;
    }
}
